<?php

//<editor-fold defaultstate="collapsed" desc="License & Copyright">
/*
 * @license
 */

/**
 *
 * @author Jevgeni Geimanen (jevgeni.geimanen@gmail.com)
 */
//</editor-fold>
class SCFormFieldValidatorCollection extends SCCollection {
    
    //<editor-fold defaultstate="collapsed" desc="FormField">
    /**
     * @var FormField
     */
    private $_FormField = null;

    /**
     *
     * @return FormField
     */
    public function getFormField() {
        return $this->_FormField;
    }

    /**
     *
     * @param FormField $field
     * @return FormField 
     */
    public function setFormField($field) {
        $this->_FormField = $field;
        return $this;
    }
    //</editor-fold>
    
    /**
     *
     * @return FormFieldValidator 
     */
    public function AddRequiredValidator() {
        return $this->Add(new RequiredFormFieldValidator());
    }
    
    
    /**
     *
     * @param FormFieldValidator $element 
     * @return FormFieldValidator
     */
    public function Add($element) {
        $element->setFormField($this->getFormField());
        return parent::Add($element);
    }
}

?>
